import request from '@/utils/request'
import { getToken } from '../utils/auth'
const token = getToken()
export function getList(page, sort) {
  return request({
    url: '/api/user/list',
    method: 'post',
    data: { page, sort }
  })
}

export function addAsk(formdata) {
  return request({
    url: '/api/user/addAsk',
    method: 'post',
    data: { token, formdata }
  })
}

export function findCon(seach) {
  return request({
    url: '/api/user/likeList',
    method: 'post',
    data: seach
  })
}

export function gerDetil(id) {
  return request({
    url: '/api/user/askDetil',
    method: 'post',
    data: {
      id: id
    }
  })
}

export function addAnser(form) {
  return request({
    url: '/api/user/addAnswer',
    method: 'post',
    data: {
      textCon: form
    }
  })
}

export function getUserQst(name) {
  return request({
    url: '/api/user/getUserQst',
    method: 'post',
    data: {
      name: name
    }
  })
}

export function UserQst(name) {
  return request({
    url: '/api/user/UserQst',
    method: 'post',
    data: {
      name: name
    }
  })
}
